﻿using Microsoft.AspNetCore.Mvc;
using DevSupport.Models;
using System.Diagnostics; 
using DevSupport.Filters;

namespace DevSupport.Controllers
{ 
    public class HomeController : BaseController
    {
        private readonly ILogger<HomeController> _logger;

        public HomeController(ILogger<HomeController> logger)
        {
            _logger = logger;
        }

        [ResourceFilter]
        public IActionResult Index()
        { 
            return View();
        }
        public IActionResult LogOut()
        {
            HttpContext.Session.Remove(WebConstant.WebSiteSessionName);
            return Redirect("~/pages/login.html");
        }
        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}